package servers

import groovy.net.xmlrpc.XMLRPCServer as Server
import core.Settings

class RpcServer {

	static RpcServer instance = new RpcServer()
	Server s
	
	private RpcServer() {
	}
	
	static void start() {
		instance.s = new Server()
		instance.s.echo = { return it }
		def socket = new ServerSocket(Settings.xmlRpcPort)
		instance.s.startServer(socket)
	}
	
	static void stop() {
		instance.s.stopServer()
		instance.s = null
	}
	

}
